package consumer;

import model.User;
import service.UserService;
import rpc.proxy.ServiceProxyFactory;


public class consumer {
    public static void main(String[] args) {
        // 获取代理
        UserService userService =ServiceProxyFactory.getProxy(UserService.class);
        User user = new User();
        user.setName("cyw");
        // 调用
        User newUser = userService.getUser(user);
        if (newUser != null) {
            System.out.println(newUser.getName());
        } else {
            System.out.println("user == null");
        }
    }
}
